package AliDiepPR.ANN.ActivationFunction;

public class HyperbolicTangensFunction implements IActivationFunction {

	double alfa = 1f;

	public HyperbolicTangensFunction() {
	}

	public HyperbolicTangensFunction(double alfa) {
		this.alfa = alfa;
	}

	@Override
	public void Alfa(double alfa) {
		this.alfa = alfa;
	}

	@Override
	public double output(double x) {
		return (double) (Math.tanh(alfa * x));
	}

	@Override
	public double output2(double y) {
		return (double) (alfa * (1 - y * y));
	}

	public String ToString() {
		return "Hyperbolic Tangens Function";
	}
}
